package com.wang.tool.trace;

import com.wang.tool.executor.transitivethreadcontext.ThreadContextTransmitter;

public class TraceThreadContextTransmitter implements ThreadContextTransmitter {


    @Override
    public Object get() {
        return TraceHolder.getCurrent();
    }

    @Override
    public void set(Object obj) {
        if (obj instanceof TraceContext) {
            TraceHolder.set((TraceContext) obj);
        } else {
            TraceHolder.clear();
        }
    }
}
